package org.snail.attendence.service;

import org.snail.attendence.bean.WxLeaveDO;
import org.snail.attendence.bean.WxleanveCondition;
import org.snail.exception.CommonException;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.List;

public interface WxLeaveService {

    /**
     * 微信预览
     * @param file
     * @param request
     * @return
     * @throws CommonException
     */
    List<WxLeaveDO> previewAttendenceWX(CommonsMultipartFile file, HttpServletRequest request) throws CommonException;

    /**
     * 微信保存
     * @param wxLeaveDOList
     * @throws CommonException
     */
    void saveAttendenceWX(List<WxLeaveDO> wxLeaveDOList) throws CommonException;

    /**
     * 获取微信考勤文件信息
     * 上传时间从文件名取通过"#0#" 隔开
     * @param request
     * @return
     */
    public List findWXFile(HttpServletRequest request);

    /**
     * 获取微信明细
     * @return
     */
    public List<WxLeaveDO> findDetails(WxleanveCondition wxleanveCondition);

    /**
     * 微信请假文件下载
     * @param filePath
     * @param request
     * @return
     * @throws IOException
     */
    public ResponseEntity<byte[]> wxLeaveDownload(String filePath, HttpServletRequest request) throws IOException, CommonException;
}
